<?php
namespace Common\Model;
use Think\Model;
class CommentModel extends Model {
    public $excel = false; //是否需要导入导出
    public $delete = true; //是否显示删除按钮
    public $update = false; //是否显示修改按钮
    public $detail = true; //是否显示详情按钮
    /**
     * model的中文名称
     */
    public $modelName = '评价';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-envelope-alt';
    protected $_auto = [
        ["create_time", "strtotime", 3, "function"],
        ["update_time", "strtotime", 3, "function"],
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["user_id", "require", "用户ID必须填写!"],
        ["commented_user_id", "require", "被评论人必须填写!"],
        ["order_id", "require", "订单ID必须填写!"],
        ["order_type", "require", "订单类型必须填写!"],
        ["score", "require", "评分必须填写!"],
        ["is_complusive", "require", "是否强制购物必须填写!"],
        ["is_guide", "require", "有无出游指导必须填写!"],
        ["is_service", "require", "旅社人员是否当面了解情况必须填写!"],
        ["is_satisfy", "require", "对本次旅游是否满意必须填写!"],
        ["is_contract", "require", "是否按合同规定内容完成必须填写!"],
        ["content", "require", "评价内容必须填写!"],
        ["create_time", "require", "创建时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];

    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "list"=>true,
            "search"=>true,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'',
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "user_id"=>[
            "type"=>"foreign",
            "name"=>"用户ID",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name,input",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "commented_user_id"=>[
            "type"=>"foreign",
            "name"=>"被评论人",
            "list"=>true,
            "search"=>true,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name,input",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_id"=>[
            "type"=>"input",
            "name"=>"订单ID",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center"><a href="{:U($vo[\'order_type\'].\'/detail\', [\'id\'=>$vo[\'order_id\']])}">{$vo[\'order_id\']}</a></td>',
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_type"=>[
            "type"=>"input",
            "name"=>"订单类型",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center">{:C("COMMENT_EN_TO_CH")[$vo["order_type"]]}</td>',
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "score"=>[
            "type"=>"input",
            "name"=>"评分",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_complusive"=>[
            "type"=>"input",
            "name"=>"是否强制购物",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_guide"=>[
            "type"=>"input",
            "name"=>"有无出游指导",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_service"=>[
            "type"=>"input",
            "name"=>"旅社人员是否当面了解情况",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_satisfy"=>[
            "type"=>"input",
            "name"=>"对本次旅游是否满意",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "is_contract"=>[
            "type"=>"input",
            "name"=>"是否按合同规定内容完成",
            "list"=>false,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "content"=>[
            "type"=>"textarea",
            "name"=>"评价内容",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"创建时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
    ];
}